<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>员工列表</title>
    <style>
        body > div > table {
            margin: 100px auto;
        }
    </style>
</head>
<body>
    <div>
        <a th:href="@{/forwardAddEmp}">添加员工信息</a>
        <table border="1" width="1000">
            <tr>
                <td>员工编号</td>
                <td>员工姓名</td>
                <td>员工邮箱</td>
                <td>操作</td>
            </tr>
            <tr th:each="emp : ${#request.getAttribute('allEmp')}">
                <td th:text="${emp.id}"></td>
                <td th:text="${emp.name}"></td>
                <td th:text="${emp.email}"></td>
                <td>
                    <a th:href="@{/emp/} + ${emp.id}">修改</a>
                    <form th:action="@{/emp/} + ${emp.id}" method="post">
                        <input type="hidden" name="_method" value="delete">
                        <input type="submit" value="删除">
                    </form>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>